var checkImage = (rule, value, callback) => {
  if (!value) {
    return callback(new Error('请上传图片'));
  }
  callback();
};

var checksliderImage = (rule, value, callback) => {
  if (!value) {
    return callback(new Error('请上传产品轮播图'));
  }
  callback();
};

const rules = {
  phoneOrEmail: [
    {
      required: true,
      message: '请输入手机号/邮箱',
      trigger: 'blue',
    },
  ],
  password: [
    {
      required: true,
      message: '请输入密码',
      trigger: 'blue',
    },
    {
      min: 3,
      max: 5,
      message: '长度在 3 到 5 个字符',
      trigger: 'blur',
    },
  ],
  passwordAgain: [
    {
      required: true,
      message: '请输入确认密码',
      trigger: 'blue',
    },
    {
      min: 3,
      max: 5,
      message: '长度在 3 到 5 个字符',
      trigger: 'blur',
    },
  ],
  authCode: [
    {
      required: true,
      message: '请输入验证码',
      trigger: 'blue',
    },
  ],
};

export default {
  rules,
};
